/*
 * @Author: tangchuan 1944302118@qq.com
 * @Date: 2024-02-27 16:22:42
 * @LastEditors: tangchuan 1944302118@qq.com
 * @LastEditTime: 2024-03-11 09:38:05
 * @FilePath: \jeecg-novel\src\views\member\bonus\UserBonusLog.data.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '消费日期',
    align: 'center',
    dataIndex: 'createTime',
  },
  {
    title: '会员用户名',
    align: 'center',
    dataIndex: 'username',
  },
  {
    title: '会员邮箱',
    align: 'center',
    dataIndex: 'email',
  },
  {
    title: '消费bonus',
    align: 'center',
    dataIndex: 'amount',
    customRender: ({ record, text }) => {
      let str = '+';
      if ([6, 7, 9].includes(record.type)) {
        str = '-';
      }
      return str + text;
    },
  },
  {
    title: '消费类型',
    align: 'center',
    dataIndex: 'remark',
  },
  {
    title: '消费小说',
    align: 'center',
    dataIndex: 'bookName',
  },
  {
    title: '消费章节',
    align: 'center',
    dataIndex: 'indexName',
  },
  {
    title: 'bonus过期时间',
    align: 'center',
    dataIndex: 'expireTime',
  },
];
columns.forEach((item) => {
  item.resizable = true;
});
//查询数据
export const searchFormSchema: FormSchema[] = [];

//表单数据
export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
